<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>日期格式化方法</title>
    
</head>
<body>
    <script type="text/javascript">
        var now = new Date();
        console.log(now);

        // 周几 年月日
        console.log(now.toDateString());

        // 时分秒 时区
        console.log(now.toTimeString());

        // 年月日
        console.log(now.toLocaleDateString());
        console.log(now.toLocaleTimeString());
        console.log(now.toLocaleString());
        console.log(now.toUTCString());
    </script>
</body>
</html>